package io.renren.modules.project.dao;

import io.renren.modules.project.entity.*;
import io.renren.modules.sys.dao.BaseDao;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * 
 * 
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2018-10-05 18:06:33
 */
@Mapper
public interface ProjectEntityDao extends BaseDao<ProjectEntityEntity> {

    // 根据userid查询任务负责人所负责任务所在的项目(但不负责此项目)id列表
    List<String> userQueryTask(String userId);

    //查询所有项目ID
    List<String> queryArr();

    //根据userid查询自己创建的项目
    List<String> ownCreateProject(String user);

    // 根据userid查询任务负责人所负责任务所在的项目(包含此项目)id列表
    List<String> userQueryTaskWithPm(String userId);

    // 根据userId查询经理所负责的项目id列表
    List<String> queryManagerOnlyList(String userId);

    List<ProjectEntityEntity> queryProjectAttachDoingTaskList(Map<String,Object> map);

    ProjectEntityEntity queryProjectId(String id);

    List<ProjectEntityEntity> queryManagerList(Map<String,Object> map);

    ProjectEntityEntity queryInfoObject(String id);

    List<Map<String,Object>> countProjectStatus(Map<String,Object> map);

    int queryProjectTotal(Map<String,Object> map);

    int projectNumberCont(String projectNumber);

    //修改项目状态为"删除"、"终止"、"恢复"
    int updateProjectStatus(Map<String,Object> map);

    List<PojectTaskEntity> queryProjectIdTaskState(String[] projectIds);

    //查询所有的附件
    List<ProjectEnclosureEntity> queryEnclosure(Map<String,Object> map);

    List<ProjectEnclosureEntity> conferenceEnclosureList(Map<String,Object> map);

    List<ProjectEnclosureEntity> sheetEnclosureList(Map<String,Object> map);

    List<ProjectEnclosureEntity> queryEnclosureTotal(Map<String,Object> map);

    int queryConferenceEnclosure(Map<String,Object> map);

    int sheetEnclosureTotal(Map<String,Object> map);

    //根据年份查找项目
    List<String> queryYear(String year);

    //根据项目ID查询任务超期
    List<OverdueEntity> queryOverdueByprojectId(List<String> list);

    @Select("SELECT project_id FROM poject_task where task_state in ('0','2','3') and task_id = #{value}")
    List<String> queryProjectTask(String str);

    List<ProjectEntityEntity> receivingStatistics(Map<String, Object> map);

    int receivingStatisticsTotal(Map<String, Object> map);

    List<ProjectExportEntity> exportXls(Map<String, Object> map);
}
